TEMPLATE = app

TARGET = icra12_pe_code
CONFIG += qt thread warn_on release silent
QT += xml opengl 
OBJECTS_DIR = .obj/
DEPENDPATH += . gui heightmap math util gui
DESTDIR = ./

LIBS *= -ltiff -lgeotiff 
LIBS *= -ljpeg
LIBS *= -L/usr/local/lib/ -lboost_iostreams-mt -lboost_serialization-mt -lexpat -lblas -llapack
LIBS *= -lCGAL -lCGAL_Core -lgmp -lmpfr -lboost_thread-mt

INCLUDEPATH *= /sw/include /usr/X11/include svg/include lib/armadillo-2.2.5/include 

macx|darwin-g++ {
   message("Compiling on Mac OS")
  INCLUDEPATH *= ${QGLVIEWER_HOME}
  LIBS *= -L${QGLVIEWER_HOME}/QGLViewer -lQGLViewer

  CONFIG -= lib_bundle
  CONFIG -= app_bundle
  DEFINES *= MAC_OS
#    OPT *= -march=x86-64 -O3

   # GLUT for Macintosh architecture
  INCLUDEPATH *= /System/Library/Frameworks/GLUT.framework/Headers
    !isEmpty( USE_GLUT ) {
       QMAKE_LIBS_OPENGL -= -lglut
       QMAKE_LIBS_OPENGL *= -framework GLUT -lobjc
    }

   QMAKE_CXXFLAGS += -Wno-deprecated
   QMAKE_CXXFLAGS_RELEASE += -fast -fstrength-reduce -floop-optimize -finline-functions
   QMAKE_CFLAGS_RELEASE += -fast -fstrength-reduce -floop-optimize -finline-functions
   QMAKE_CXXFLAGS_DEBUG = $$QMAKE_CXXFLAGS_RELEASE
   QMAKE_CFLAGS_DEBUG = $$QMAKE_CFLAGS_RELEASE


    # This is a hack, please remove if you experience problems
    # or install the colorgcc package
    #QMAKE_CXX=colorgcc

    # OpenCV
     INCLUDEPATH *= /usr/local/Cellar/opencv/2.3.1a/include/opencv/ 
     LIBS *= -lopencv_core -lopencv_highgui  -lopencv_imgproc
}

linux-g++ {
   message("Compiling on LINUX")
   INCLUDEPATH *= /usr/include/opencv/
   INCLUDEPATH *= /usr/include/GL/
   INCLUDEPATH *= /usr/include/opencv-2.3.1/
   INCLUDEPATH *= /usr/include/opencv-2.3.1/opencv/
   QMAKE_CXXFLAGS += -Wno-deprecated
   QMAKE_CXXFLAGS_RELEASE +=  -floop-optimize -finline-functions -O3 -funroll-loops -march=i686
   QMAKE_CFLAGS_RELEASE += -floop-optimize -finline-functions -O3 -funroll-loops -march=i686
   QMAKE_CXXFLAGS_DEBUG = $$QMAKE_CXXFLAGS_RELEASE
   QMAKE_CFLAGS_DEBUG = $$QMAKE_CFLAGS_RELEASE
#   LIBS *= -lopencv_cxcore -lopencv_cv -lopencv_highgui -lopencv_cvaux
   LIBS *= -lopencv_core -lopencv_highgui
   LIBS *= -lopencv_legacy -lopencv_imgproc
   LIBS *= -L${QGLVIEWER_HOME}/QGLViewer -lQGLViewer
   LIBS *= -L/usr/lib/
}

# Input
HEADERS += paramfile.h \
           agentstate.h \
           perimeter.h\
           hmabstraction.h\
           gui/glHelpers.h \
           gui/viewer.h \
           gui/terrain.h \
           gui/animator.h\
           heightmap/heightcell.h \
           heightmap/heightmap.h \
           heightmap/heightMapClassifier.h \
           heightmap/scan3d.h \
           math/bresenham.h \
           math/matrix.h \
           math/matrix3d.h \
           math/vector.h \
           math/vector2.h \
           math/vector3.h \
           math/vector3d.h \
           math/vector4.h \
           util/angles.h \
           util/misc.h \
           util/statistics.h \
           util/timeutil.h \
           util/filesysTools.h\
           util/timing.h\
           util/gpsconvert.h\
           geomap.h\
           visibility.h\
           planner/aStarNode.h \
           planner/aStarSearch.h \
           planner/planningCell.h \
           planner/planningMap.h \
           planner/hungarian.h\
           planner/priorityQueue.h\
           uavmodel/navpoint.h\
           hungarian/hungarian2.h\
           hungarian/munkres/matrix.h\
           hungarian/munkres/munkres.h\
           polygonization.h\
           polygonization/alpha_shape.h\
           polygonization/dp_line_simplification.h\
           polygonization/polygon.h\
           polygonization/polygon_environment.h\
           polygonization/voronoi_diagram.h\


SOURCES += \
          heightmap/heightcell.cpp \
           heightmap/heightmap.cpp \
           heightmap/heightMapClassifier.cpp \
           heightmap/scan3d.cpp \
           math/bresenham.cpp \
           math/matrix.c \
           math/matrix3d.cpp \
           math/vector3d.cpp \
           util/angles.cpp \
           util/misc.c \
           util/timeutil.cpp \
           util/timing.cpp\
           util/filesysTools.cpp\
           util/gpsconvert.cpp\
           planner/aStarNode.cpp \
           planner/aStarSearch.cpp \
           planner/planningCell.cpp \
           planner/planningMap.cpp \
           planner/priorityQueue.cpp\
           planner/hungarian.cpp\
           uavmodel/navpoint.cpp\
           polygonization.cpp\
           polygonization/alpha_shape.cpp\
           polygonization/dp_line_simplification.cpp\
           polygonization/geometry_util.cpp\
           polygonization/polygon.cpp\
           polygonization/polygon_environment.cpp\
           polygonization/voronoi_diagram.cpp\
           lineclear/ChoiceSet.cpp\
           lineclear/ChoiceTree.cpp\
           lineclear/Cut.cpp\
           lineclear/CutSequence.cpp\
           lineclear/Environment.cpp\
           lineclear/ObstacleSequence.cpp\
           lineclear/ObstacleSequenceStep.cpp\
           geomap.cpp\
           paramfile.cpp\
           agentstate.cpp\
           perimeter.cpp \
           polygons.cpp\
           hmabstraction.cpp\
           jpegImage.cpp\
           jpeg_codec.cpp\
           memdata_mgr.cpp\
           visibility.cpp\
           gui/glHelpers.cpp \
           gui/viewer.cpp \
           gui/terrain.cpp \
           gui/animator.cpp\
           hungarian/munkres/matrix.cpp\
           hungarian/munkres/munkres.cpp\
           hungarian/hungarian2.cpp\
           main.cpp 
